<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<div class="report-detection-result">
    <i [lv-icon]="detectionIcon"></i>
    <div class="no-data-label">
        <h1 class="aui-gutter-column-sm">{{detectionResultLabel}}</h1>
    </div>
    <div class="no-data-label" *ngIf="copyDataLabel">
        <p class="aui-text-help-sm aui-gutter-column-lg" *ngIf="!isEn">
            {{copyDataLabel}}{{'common_copy_data_label' | i18n }}{{detectionResultLabel}}
        </p>
        <p class="aui-text-help-sm aui-gutter-column-lg" *ngIf="isEn">
            {{copyDataLabel}} {{'common_copy_data_label' | i18n }} {{detectionResultLabel}}
        </p>
    </div>
</div>
<div class="report-detail aui-gutter-column-md" *ngIf="rowData?.handle_false && reportLabel">
    <span [innerHTML]="reportLabel"></span>
</div>
<div class="basic-info">
    <lv-form [lvLabelColon]='false'>
        <lv-form-item>
            <lv-form-label style="padding-bottom: 0.2rem">
                {{ 'protection_hyperdetect_copy_name_label' | i18n}}
            </lv-form-label>
            <lv-form-control>
                <span lv-overflow>{{ rowData?.name | nil}}</span>
            </lv-form-control>
        </lv-form-item>
        <lv-form-column *ngFor='let column of formItems' lvWidth="40%">
            <lv-form-item *ngFor='let item of column'>
                <lv-form-label>
                    {{item.label}}
                </lv-form-label>
                <lv-form-control>
                    <span lv-overflow class="content-warp">{{item.content | nil}}</span>
                </lv-form-control>
            </lv-form-item>
        </lv-form-column>
    </lv-form>
</div>
<div class="file-list">
    <div class="aui-operation">
        <lv-group></lv-group>
        <i lv-icon="lv-icon-download" [lvColorState]="true" (click)="exportResult()"
            lv-tooltip="{{'common_download_label' | i18n}}"></i>
    </div>
    <lv-pro-table #dataTable [config]="tableConfig" [data]="tableData"></lv-pro-table>
</div>

<ng-template #sizeTpl let-item>
    <span lv-overflow>
        {{item.fileSize | capacityCalculateLabel:'1.1-3':unitconst.BYTE:true:true}}
    </span>
</ng-template>

<ng-template #attrTpl let-item>
    <lv-group lvGutter='8px' lv-overflow>
        <span>{{'common_create_time_label' | i18n:[]:true}}</span>
        <span>{{item.createDate}}</span>
    </lv-group>
    <lv-group lvGutter='8px' lv-overflow>
        <span>{{'protection_last_modifyed_label' | i18n:[]:true}}</span>
        <span>{{item.lastModifyDate}}</span>
    </lv-group>
</ng-template>

<ng-template #subjectUserTpl>
    <i lv-icon="aui-icon-help" lv-tooltip="{{'explore_subject_user_tip_label' | i18n}}" lvTooltipTheme="light"
        class="operation-help-icon" lvColorState='true'></i>
</ng-template>

<ng-template #fileTpl let-item>
    <lv-group lvGutter='8px'>
        <div lv-overflow>
            <span>{{ item.file }}</span>
        </div>
        <span class="guide-recommend-label honeypot-min-tag" *ngIf="item.honeypotFile">
            {{'explore_honeypot_file_label' | i18n}}
        </span>
    </lv-group>
</ng-template>